#!/bin/csh -f
#          _/             _/_/
#        _/_/           _/_/_/
#      _/_/_/_/         _/_/_/
#      _/_/_/_/_/       _/_/_/              ____________________________________________ 
#      _/_/_/_/_/       _/_/_/             /                                           / 
#      _/_/_/_/_/       _/_/_/            /                                 28F00AP30 / 
#      _/_/_/_/_/       _/_/_/           /                                           /  
#      _/_/_/_/_/_/     _/_/_/          /                                     1Gbit / 
#      _/_/_/_/_/_/     _/_/_/         /                                single die / 
#      _/_/_/ _/_/_/    _/_/_/        /                                           / 
#      _/_/_/  _/_/_/   _/_/_/       /                  Verilog Behavioral Model / 
#      _/_/_/   _/_/_/  _/_/_/      /                               Version 1.4 / 
#      _/_/_/    _/_/_/ _/_/_/     /                                           /
#      _/_/_/     _/_/_/_/_/_/    /           Copyright (c) 2010 Numonyx B.V. / 
#      _/_/_/      _/_/_/_/_/    /___________________________________________/ 
#      _/_/_/       _/_/_/_/      
#      _/_/          _/_/_/  
# 
#     
#             NUMONYX              


set RUNDIR  = ./
set LIBDIR  = ./include
set CODEDIR = ./code
set STIMDIR = ./stim
set TOPDIR  = ./top
set SIMDIR  = ./sim
set HDLPATH = ./hdl.var
set CDSPATH = ./cds.lib


if (-e work) then
\rm -r work
endif
mkdir work


#CODE
ncvlog  -cdslib $CDSPATH -hdlvar $HDLPATH -MESSAGES -NOCOPYRIGHT -LINEDEBUG   $CODEDIR/28F00AP30.v
if ( $status != 0 ) exit 3


#STIM
ncvlog  -cdslib $CDSPATH -hdlvar $HDLPATH -MESSAGES -NOCOPYRIGHT -LINEDEBUG  $STIMDIR//read/page_read.v
if ( $status != 0 ) exit 4


#TOP
ncvlog  -cdslib $CDSPATH -hdlvar $HDLPATH -MESSAGES -NOCOPYRIGHT -LINEDEBUG  $TOPDIR/top.v
if ( $status != 0 ) exit 5


cd $SIMDIR


# Elaborate
ncelab -cdslib ../$CDSPATH -hdlvar ../$HDLPATH -mess -NOWARN CUDEFB work.top -access +r
if ( $status != 0 ) exit 6


# Simulate
ncsim -cdslib ../$CDSPATH -hdlvar ../$HDLPATH work.top -gui  $1 &
if ( $status != 0 ) exit 7


